package com.example.ovulationperiodtracker;

import android.app.Application;

import com.example.ovulationperiodtracker.utils.Constants;
import com.tencent.mmkv.MMKV;
import com.umeng.analytics.MobclickAgent;
import com.umeng.commonsdk.UMConfigure;

public class MyApplication extends Application {


    public static Application context;




    @Override
    public void onCreate() {
        super.onCreate();
        context = this;
        MMKV.initialize(this);
      //  OkGo.getInstance().init(this);
        MMKV mmkv = MMKV.defaultMMKV();
        boolean firstIn = mmkv.decodeBool(Constants.FIRST_IN, true);
        if (!firstIn) {
            initUM();
        }

    }

    public static void initUM() {
        UMConfigure.preInit(context, Constants.UM_APPID, BuildConfig.CHANNEL);
        UMConfigure.init(context, Constants.UM_APPID, null, UMConfigure.DEVICE_TYPE_PHONE, "");
        UMConfigure.setLogEnabled(false);
        MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO);
        UMConfigure.setProcessEvent(true);
    }

}
